<template>
  <!-- 全局设置 -->
  <view class="Teamstatistics">
    <view class="contentbelow">
      <view class="more">新增考勤组</view>
      <up-cell-group>
        <up-cell icon="setting-fill" title="办公室" :isLink="true" value="214人"></up-cell>
        <up-cell icon="grid" title="科研中心" :isLink="true" value="206人"></up-cell>
        <up-cell icon="grid" title="蔬菜研究所" :isLink="true" value="0人"></up-cell>
      </up-cell-group>
      <view style="text-align: center;margin-top: 10px;font-size: 14px;">查看全部</view>
    </view>

    <view class="contentbelow">

      <up-cell-group :border="false">
        <up-cell icon="setting-fill" title="智能考勤机" :isLink="true"></up-cell>
      </up-cell-group>
    </view>

    <view class="contentbelow">
      <view class="more">更多设置</view>
      <view>

      </view>
    </view>

  </view>
</template>

<script>
export default {
  name: "Teamstatistics",
  data () {
    return {

    };
  },
  created () {

  },
  onReady () {
    this.getServerData()
  },
  mounted () {
    this.$nextTick(() => {
      this.initChart();
    });
  },

  methods: {
    initChart () {

    }
  }
}

</script>

<style lang="scss" scoped>
.Teamstatistics {
  margin-bottom: 50px;
  width: 100%;
  height: 100%;

  .contentupper {
    position: relative;
    text-align: center;
    padding: 10px 10px;
    height: 60vh;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

    .progress-container {
      margin: 0 auto 30rpx;
      width: 400rpx; // 增大容器宽度 

      .chart-wrapper {
        width: 400rpx; // 增大容器 
        height: 250rpx; // 保持0.5比例 

        .progress-canvas {
          width: 400rpx !important; // 放大画布尺寸 
          height: 450rpx !important;
        }
      }
    }

    .stats-container {
      display: flex;
      justify-content: space-around;
      padding: 8px 0;
      margin: 12px 0;

      .stat-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 4px 0;
      }

      .stat-number {
        font-size: 1.5625rem; // 25px 
        line-height: 1.2;
        color: #333;
        margin-bottom: 2px;
      }

      .stat-label {
        font-size: 0.75rem; // 12px 
        line-height: 1.4;
        color: #666;
      }
    }

    .status-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 18px;
    }

    .status-tag {
      background: #e5e5e5;
      border-radius: 5px;
      padding: 5px 12px;
      display: inline-flex;
      align-items: center;
      flex: 0 0 auto;
      /* 根据内容自适应宽度 */
      /* 移除固定width: 60px */
    }

    .status-text {
      font-size: 13px;
      margin-right: 4px;
    }

    .status-count {
      font-size: 12px;
    }

    .attendance-table {
      // border: 1px solid #ebeef5; 
      border-radius: 4px;
      margin: 12px 0;
    }

    .attendance-header,
    .attendance-row {
      display: flex;
      align-items: center;
      padding: 12px;

      .header-item,
      .row-item {
        flex: 1;
        font-size: 12px;
        color: #606266;

        &.department {
          flex: 2; // 部门名称列更宽 
          text-align: left;
          padding-left: 8px;
        }
      }
    }

    .attendance-header {
      // background-color: #f5f7fa; 
      // border-bottom: 1px solid #ebeef5; 

      .header-item {
        font-weight: 600;
        color: #909399;
      }
    }

    .attendance-row {
      &:not(:last-child) {
        border-bottom: 1px solid #ebeef5;
      }

      .row-item {
        color: #303133;

        &:nth-child(2) {
          // 出勤人数列 
          text-align: center;
        }

        &:last-child {
          // 平均工时列 
          text-align: right;
          padding-right: 8px;
        }
      }
    }

    // 处理长文本 
    .department {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .attendancerate-footer {
      text-align: left;
      position: absolute;
      bottom: 6px;
      font-size: 12px;
      color: #909193;
      left: 16px;
    }
  }
}




.row-itemtopView {
  display: flex;
  width: 162px;
}

.row-itemtopSpan {
  font-size: 16px;
  color: #10AEFF;
}

.row-itemtopprogress {
  width: 65px;
  position: relative;
  top: 23px;
}

.contentbelow {
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin-top: 10px;

  .more {
    padding: 0px 10px 10px 0px;
  }
}
</style>

<style scoped>
/deep/ .row-itemtopprogress .uni-progress-inner-bar {
  border-radius: 5px;
}
</style>